package xcu.lxj.nettychat.chat.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import xcu.lxj.nettychat.chat.constant.MQConstant;
import xcu.lxj.nettychat.chat.domain.dto.PushMessageDTO;
import xcu.lxj.nettychat.chat.domain.vo.response.WSBaseResp;
import xcu.lxj.nettychat.chat.utils.MQProducer;

import java.util.List;

/**
 * @Author XinJian Lei
 * @Date 2024/9/29 14:36
 * @Version 1.0
 */
@Service
public class PushService {

    @Autowired
    private MQProducer mqProducer;

    public void sendPushMsg(WSBaseResp<?> msg, List<Long> uidList) {
        mqProducer.sendMsg(MQConstant.PUSH_TOPIC, new PushMessageDTO(uidList, msg));
    }

    public void sendPushMsg(WSBaseResp<?> msg, Long uid) {
        mqProducer.sendMsg(MQConstant.PUSH_TOPIC, new PushMessageDTO(uid, msg));
    }

    public void sendPushMsg(WSBaseResp<?> msg) {
        mqProducer.sendMsg(MQConstant.PUSH_TOPIC, new PushMessageDTO(msg));
    }


}
